package com.eight.voteDao;

import com.eight.entity.Picture;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface PictureDao extends JpaRepository<Picture,Integer> {

    @Query(value = "select * from picture order by votenumber desc limit 10",nativeQuery = true)
    List<Picture> findAllByList();

    @Query(value="select * from picture where id=?",nativeQuery = true)
    Picture findByPictureId(int id);

}
